package com.waitingsnow.core.mobile
{
import com.waitingsnow.core.debug.Logger;

import flash.net.URLRequest;
import flash.net.navigateToURL;

/**
 * 
 * @author waitingsnow
 * $Id: MobileUtil.as 2 2012-05-17 10:10:03Z cgslendy@gmail.com $
 */
public class MobileUtil
{
	/**
	 * 打电话
	 * @param msg
	 * 
	 */	
	static public function callPhone(msg:String = "86"):void
	{
		try
		{
			navigateToURL(new URLRequest("tel:+" + msg));
		}
		catch (e:Error)
		{
			Logger.error("callPhone error: " + e.getStackTrace());
		}
	}
	
	/**
	 * 打电话
	 * @param msg
	 * 
	 */	
	static public function callSms(msg:String = "86"):void
	{
		try
		{
			navigateToURL(new URLRequest("sms:" + msg));
		}
		catch (e:Error)
		{
			Logger.error("callSms error: " + e.getStackTrace());
		}
	}
	
	/**
	 * 发邮件
	 * @param msg
	 * 
	 */	
	static public function sendEmail(msg:String = "@"):void
	{
		try
		{
			navigateToURL(new URLRequest("mailto:" + msg));
		}
		catch (e:Error)
		{
			Logger.error("sendEmail error: " + e.getStackTrace());
		}
	}
}
}